class CreateResources < ActiveRecord::Migration
  def self.up
    create_table :resources do |t|
      t.integer :orders,:null =>false
      t.string :name,:null =>false
      t.string :desc
      t.boolean :status,:null =>false
      t.string :level,:null =>false
      t.integer :col_id,:null =>false
      t.string :res_type,:null =>false
      t.boolean :is_dy,:default =>false      
      t.string :res_dir,:defalut => false
      t.integer  :click_num, :null => false,:default => 0
      t.integer  :support_num, :null => false,:default => 0
      t.integer  :oppose_num, :null => false,:default => 0
      t.float  :score, :null => false,:default => 0
      t.float  :day_score, :null => false,:default => 0
      t.float  :week_score, :null => false,:default => 0
      t.float  :month_score, :null => false,:default => 0
      t.integer :channel_id,:null => true
      t.timestamps
    end
  end

  def self.down
    drop_table :resources
  end
end
